﻿using System;
using System.Collections.Generic;
using Loki.Model;

namespace Loki
{
    public interface ITaskComponent
    {
        ITask CreateWorker(string P_Title, Action P_DoWork, Action P_OnComplete, Action<Exception> P_OnError);

        ITask<TArgument> CreateWorker<TArgument, TResult>(string P_Title, Action P_Before, Func<TArgument, TResult> P_DoWork, Action<TResult> P_OnComplete, Action<Exception> P_OnError);

        ITaskWithUpdate CreateUpdatetableWorker(string P_Title, Action<ITaskUpdater> P_DoWork, Action P_OnComplete, Action<Exception> P_OnError);

        ITask<TArgument> CreateWorker<TArgument, TResult>(string P_Title, Func<TArgument, TResult> P_DoWork, Action<TResult> P_OnComplete, Action<Exception> P_OnError);

        ITask<TArgument> CreateUpdatetableWorker<TArgument, TResult>(string P_Title, Action<ITaskUpdater, TArgument, TResult> P_DoWork, Action<TResult> P_OnComplete, Action<Exception> P_OnError);

        IEnumerable<ITaskStatus> WorkingProcess { get; }

        ITaskStatus GetStatus(ITask P_Task);
    }
}